package com.hujiang.basic.search.common.converter.req;

import org.elasticsearch.action.update.UpdateRequest;
import org.springframework.stereotype.Component;

import com.hujiang.basic.search.common.converter.Converter;
import com.hujiang.basic.search.model.HJUpdateRequest;

@Component
public class UpdateRequestConverter implements Converter<HJUpdateRequest, UpdateRequest> {

    @Override
    public UpdateRequest convert(HJUpdateRequest in) {
        return new UpdateRequest(in.getIndex(), in.getType(), in.getId()).doc(in.getSource());
    }
}
